package com.duomizhibo.phonelive.fragment;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.TextView;
import android.widget.Toast;

import com.duomizhibo.phonelive.AppConfig;
import com.duomizhibo.phonelive.R;
import com.duomizhibo.phonelive.sharepreference.MySharePreferenceUtil;

import java.util.Locale;


@SuppressLint("ValidFragment")
public class SimpleCardFragment2 extends Fragment {
    private String mTitle;



    WebView order_wv;
    public static SimpleCardFragment2 getInstance(String title) {
        SimpleCardFragment2 sf = new SimpleCardFragment2();
        sf.mTitle = title;
        return sf;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fr_simple_card2, null);
        TextView card_title_tv = (TextView) v.findViewById(R.id.card_title_tv);
        card_title_tv.setText(mTitle);
        order_wv= (WebView) v.findViewById(R.id.order_wv);
        String mUid= (String) MySharePreferenceUtil.get(getActivity(),"id","");
        //周
//        http://apizb.meibo520.com/index.php?g=appapi&m=Contribute&a=order&type=week&uid=11439&type=week


//        http://apizb.meibo520.com/index.php?g=appapi&m=Contribute&a=order&type=week&uid=11439&type=week
//
//        Toast.makeText(getActivity(),"333333333",Toast.LENGTH_LONG).show();

        String url = String.format(Locale.CHINA,
                AppConfig.MAIN_URL + "/index.php?g=appapi&m=Contribute&a=order&type=week&uid="+ "11439" +"&type=all");
        Log.d("rrrrrrrrrrrr",url);
        Log.d("rrrrrrrrrrrr",url);
        //月
//        http://apizb.meibo520.com/index.php?g=appapi&m=Contribute&a=order&type=week&uid=11439&type=all
        order_wv.loadUrl(url);

        return v;
    }
}